CREATE TABLE [dbo].[TTAMAR_NCCA]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[NU_AMAR] [dbo].[TD_VC_008] NOT NULL,
[FE_AMAR] [dbo].[TD_DT_001] NOT NULL,
[CO_TIPO_OPER] [dbo].[TD_VC_003] NOT NULL,
[FE_ANUL] [dbo].[TD_DT_001] NOT NULL,
[ST_CONT] [dbo].[TD_VC_001_INTE] NOT NULL CONSTRAINT [DF__TTAMAR_NC__ST_CO__443605EA] DEFAULT ('N'),
[NU_PROC] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TTAMAR_NC__NU_PR__461E4E5C] DEFAULT ((0)),
[NU_ASTO] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTAMAR_NC__CO_US__47127295] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTAMAR_NC__FE_US__480696CE] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTAMAR_NC__CO_US__48FABB07] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTAMAR_NC__FE_US__49EEDF40] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTAMAR_NCCA] WITH NOCHECK ADD CONSTRAINT [CK__TTAMAR_NC__ST_CO__452A2A23] CHECK NOT FOR REPLICATION (([ST_CONT]='P' OR [ST_CONT]='N'))
GO
ALTER TABLE [dbo].[TTAMAR_NCCA] ADD CONSTRAINT [PK__TTAMAR_N__DA2E927F3F47339B] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_UNID_CONC], [NU_AMAR], [FE_AMAR]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTAMAR_NCCA] ADD CONSTRAINT [FK__TTAMAR_NCCA__3024EB9C] FOREIGN KEY ([CO_EMPR], [CO_TIPO_OPER]) REFERENCES [dbo].[TTTIPO_OPER] ([CO_EMPR], [CO_TIPO_OPER])
GO
ALTER TABLE [dbo].[TTAMAR_NCCA] ADD CONSTRAINT [FK__TTAMAR_NCCA__31190FD5] FOREIGN KEY ([CO_EMPR], [CO_UNID_CONC], [NU_AMAR], [FE_AMAR]) REFERENCES [dbo].[TCAMAR_NCCL] ([CO_EMPR], [CO_UNID_CONC], [NU_AMAR], [FE_AMAR])
GO
